package com.jsu.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.jsu.bean.LMatchFId;
import com.jsu.bean.LostId;
import com.jsu.dao.LostMessageMapper;
import com.jsu.service.GetLostFaceToken;
import com.jsu.service.LostMatchToFound;
@Component
public class LMatchFTask {

	@Autowired
	LostMessageMapper lostMessageMapper;
	@Autowired
	LostMatchToFound lostMatchToFound;
	
	
	//@Scheduled(fixedDelay = 15*1_000)
	public void run() {
		String photoBasic = "E:\\photo\\";
		LMatchFId lMatchFId = LMatchFId.getInstance();
		System.out.println("LMatchF上一次任务执行后当前id及最大id分别是"+lMatchFId.getCurrentId()+" "+lMatchFId.getMaxId());
		int id = lostMessageMapper.selectLastId();
		System.out.println("查询到id是"+id);
		int tmp = lMatchFId.getMaxId();
		lMatchFId.setCurrentId(tmp);
		if(id>tmp){
			lMatchFId.setMaxId(id);
			lostMatchToFound.setTar(lMatchFId, photoBasic);
			lostMatchToFound.run();
		}
	}
}
